﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.components {
    import flash.events.*;
    import flash.display.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.utils.*;

    public class ConstructionSite extends Sprite {

        public function createBuildRoomButtons(_arg1:String, _arg2:int, _arg3:int):void{
            var _local4:MovieClip;
            _local4 = AssetsLibrary.getMovieClip("Shovel");
            _local4.name = _arg1;
            _local4.x = _arg2;
            _local4.y = _arg3;
            addChild(_local4);
            _local4.buttonMode = true;
            _local4.gotoAndStop("mouse_out");
            _local4.addEventListener(MouseEvent.MOUSE_OVER, this.mouseOver);
            _local4.addEventListener(MouseEvent.MOUSE_OUT, this.mouseOut);
            _local4.addEventListener(MouseEvent.CLICK, this.handleClick);
        }
        public function removeRoomButton(_arg1:String):void{
            removeChild(getChildByName(_arg1));
        }
        private function mouseOut(_arg1:MouseEvent):void{
            MovieClip(_arg1.target).gotoAndStop("mouse_out");
        }
        private function mouseOver(_arg1:MouseEvent):void{
            MovieClip(_arg1.target).gotoAndStop("mouse_over");
        }
        private function handleClick(_arg1:MouseEvent):void{
            dispatchEvent(new ViewCompEvent(ViewCompEvent.CLICK, _arg1.currentTarget.name));
        }

    }
}//package net.wooga.pets.views.components 
